package com.job.Gai_Yian.Homework0712;

import com.job.springsea.work0712.AttackA;
import jdk.internal.util.xml.impl.Input;
import jdk.nashorn.internal.ir.LexicalContext;
import jdk.nashorn.internal.ir.LexicalContextNode;

import java.util.Scanner;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-13 10:46:32
 */
public class TextTigger {
    public static void main(String[] args) {
        Tigger tigger=new Tigger();
        Scanner sc=new Scanner(System.in);
        System.out.println("请选择攻击方式:");
        System.out.println("1.扑"+"\t"+"2.咬"+"\t"+"3.抓");
        int method=sc.nextInt();
        Attack a=AttackFactory.getAttack(method);
        if (a==null){
            Attack n=new Attack() {
                @Override
                public void BodyPart() {
                    System.out.println("无对应的攻击时使用的身体部位");
                }
                @Override
                public void AttackMethod() {
                    System.out.println("无对应的攻击方式");
                }
                @Override
                public void Power() {
                    System.out.println("无对应的攻击等级");
                }
            };
            n.AttackMethod();
            n.BodyPart();
            n.Power();
        }
        else{
            a.AttackMethod();
            a.BodyPart();
            a.Power();
        }
    }
}
